<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a="http://richfaces.org/a4j"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:rg="http://www.ruijie.com.cn/faces/ui"
	template="/layout/dialogLayout.xhtml">

	<ui:param name="param_panelTitle" value="更新订单状态" />
	<ui:param name="param_panelWidth" value="400px" />

	<ui:define name="content">
	<script type="text/javascript">
        function reRender(){
            try{
                	UI.instance.reRender('reRenderOrderTableModel');
            }catch(err){
                    UI.instance.resetContent("/luyuan/sale/orderListForStorage.jsf")
            }
        	UI.instance.closeDialog();
        }

        function print() {
			//var shipNum =jQuery("#orderShip\\:shipNum").val();
			//if (shipNum === '') {
			//	return false;
			//}
			//if(#{orderStorageAction.order.orderType == 'SINGLE_PRODUCT'}) {
			//	window.open('#{ctx}/luyuan/sale/printProducts.jsf?orderId=#{orderStorageAction.order.id}&#38;shipNum='+shipNum);
			//} else if (#{orderStorageAction.order.orderType == 'FORMULA'}){
			//	window.open('#{ctx}/luyuan/sale/printFormula.jsf?orderId=#{orderStorageAction.order.id}&#38;shipNum='+shipNum);
			//}
		}
       </script>
		<h:form id="orderShip">
			<rg:titlePanel  type="writable" needButton="true">
				<ui:define name="panelBody">
					<rg:fieldSet column="singleLine">
						<rg:selectOne id="shipMethodType"
							value="#{orderStorageAction.order.delivery.expressCompany}" label="快递方式"
                            itemsProvider="#{expressCompanyProvider}" converter="#{expressCompanyConverter}"/>
							
						<rg:inputText id="deliveryNumber"
							value="#{orderStorageAction.order.delivery.deliveryNumber}" label="快递号" />
							
						<rg:inputArea label="备注"
							value="#{orderStorageAction.remarks}"
							id="remarks" cols="100" />
					</rg:fieldSet>
				</ui:define>
				<ui:define name="panelButton">
					<a:commandButton styleClass="button" value="确认发货"
						onclick="print();" oncomplete="reRender();"
						actionListener="#{orderStorageAction.deliverOrder()}" />

					<a:commandButton styleClass="button" value="关闭"
						onclick="UI.instance.closeDialog()" />
				</ui:define>
			</rg:titlePanel>
		</h:form>
	</ui:define>
</ui:composition>
